﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace InputProductForm
{
    class TQuality
    {
        UTLDB.UTLDB _cn = new UTLDB.UTLDB();
        public DataTable GetQuality()
        {
            DataTable data = new DataTable();
            data = _cn.GetDataByStoredProcedure("usp_SelecttblQuality");
            return data;
        }
        public int Insert(string name, string sym, bool active)
        {

            int i = _cn.ExecuteInsert("usp_InserttblQuality",
               new string[] { "@Name","@Symbol", "@Active" },
               new object[] { name,sym, active });
            return i;
        }
        public void Update(int id, string name,string sym, bool active)
        {
            int i = _cn.ExecuteNonQuery("usp_UpdatetblQuality",
                  new string[] { "@ID", "@Name","@Symbol", "@Active" },
                  new object[] { id, name,sym, active});

        }

    }
}
